package com.ideaaedi.extspringcache.test.test4refresh;


import com.ideaaedi.extspringcache.refresh.CacheValueRefresher;
import org.aspectj.lang.JoinPoint;
import org.springframework.stereotype.Component;

/**
 * 缓存值刷新器
 *
 * @author JustryDeng
 * @since 2020/11/23 12:39:53
 */
@Component
public class MyCacheValueRefresher implements CacheValueRefresher {
    
    @Override
    public boolean refresh(JoinPoint joinPoint) {
        boolean refresh = false;
        try {
            refresh = joinPoint.getArgs()[0].toString().contains("refresh");
        } catch (Exception e) {
            // ignore
        }
        return refresh;
    }
}
